<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ajax</title>
</head>
<body>
<div>
    <input type="button" name="btn" onclick="javascript:send();" value="点击" >
</div>

<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
<script type="javascript">
    function send() {
        $.post(
            "/community/alpha/ajax",
            {
                "name": "张三",
                "age": 15
            },
            function (data) {
                console.log(typeof(data))
                console.log(data)

                data = $.parseJson(data);

                console.log(typeof(data))
                console.log(data.msg)
                console.log(data.code)
            }
        )
    }
</script>
</body>
</html>